<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="modal-dialog ms-modal-dialog" style = "width: 800px; font-size: .6rem;">
  <div class="modal-content">

    <div class="modal-header">
      <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
      <h4 class="modal-title">修改基本业务信息</h4>
    </div>
      
    <form class="form-horizontal ms-form modal-search-form" role="form" method="POST" action="${ctx.host}/suppliers/${supplierId}/supplier-certificate" 
          data-validate="true" data-anchor="#anchor-supplier-certificate">
    
      <input type="hidden" name="_method" value="PATCH" />
      <input type="hidden" name="supplierCertificateId" value="${supplierCertificate.id}" />
      <input type="hidden" name="supplier" value="${supplierId}" />
      
      <div class="modal-body">
         
        <div class="form-horizontal ms-form form-personal-info">

          <div class="form-group  ms-form-group">
              <label class="control-label col-xs-3">16&nbsp;<span class="color-red">*</span>管理人员(人)：</label>
              <div class="col-xs-3 pull-left">
                  <input type="text" name="managerNum" class="form-control" value="${supplierCertificate.managerNum }" data-validate="required|number" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
              <label class="control-label col-xs-3">17&nbsp;<span class="color-red">*</span>具体作业人员(人)：</label>
              <div class="col-xs-3 pull-left">
                  <input type="text" name="operatorNum" class="form-control" value="${supplierCertificate.operatorNum }" data-validate="required|number" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
          </div>

          <div class="form-group ms-form-group">
              <label class="control-label col-xs-3 ">18&nbsp;<span class="color-red">*</span>公司规模(年预计销售收入)：</label>
              <div class="col-xs-3 pull-left">
                <select class="select2 form-control" name="companySize" tabindex="1" data-validate="required">
                  <option></option>
                  <c:forEach var="companySize" items="${enums['CompanySize'] }">
                      <option value="${companySize.code }" ${companySize.code eq supplierCertificate.companySize ? 'selected' : ''}>${supplier.type.alias eq 'motor'? companySize.transDescription:companySize.wareDescription}</option>
                    </c:forEach>
                 </select>
              </div>
              
              <label class="control-label col-xs-3">19&nbsp;<span class="color-red">*</span>固定成本(元/板/年)：</label>
              <div class="col-xs-3 pull-left">
                  <input type="text" name="constantCost" class="form-control" value="${supplierCertificate.constantCost }" data-validate="required|max_decimal_digit,2" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
          </div>


          <div class="form-group ms-form-group">
              <label class="control-label col-xs-3">20&nbsp;<span class="color-red">*</span>变动成本(元/板/公里)：</label>
              <div class="col-xs-3 pull-left">
                  <input type="text" name="variableCost" class="form-control" value="${supplierCertificate.variableCost}" data-validate="required|max_decimal_digit,2" placeholder="" tabindex="1" autocomplete="off"/>
              </div>
          </div>
            
          </div>
        </div>

      <div class="modal-footer ms-modal-footer">
        <button type="submit" class="btn ms-btn btn-primary">确定</button>
        <button type="button" class="btn ms-btn ms-btn-gary" data-dismiss="modal">取消</button>
      </div>
    </form>
      
  </div>
</div>

<script type="text/javascript">
    $(document).ready(function () {

        $('select[name="companySize"]').select2({
            theme: "classic",
            placeholder: '请选择',
            minimumResultsForSearch: -1,
            allowClear: true,
        });

    })
</script>